<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>{:session('cp.cpsysname')}--商户管理平台</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
    <meta name="description" content="{:config('webconfig.description');}">
    <meta name="keywords" content="{:config('webconfig.keywords');}">
    <meta name="author" content="runoob">
    <link rel="stylesheet" href="__STATIC_URL__/static/css/bootstrap.css">
    <link rel="stylesheet" type="text/css" href="__STATIC_URL__/static/css/index.css"/>
    <link rel="stylesheet" type="text/css" href="__STATIC_URL__/static/css/bootstrap-datetimepicker.css"/>
    <link rel="stylesheet" href="__STATIC_URL__/static/css/bootstrapSwitch.css">

    <script src="__STATIC_URL__/static/js/jquery-2.1.4.min.js" type="text/javascript" charset="utf-8"></script>

    <script src="__STATIC_URL__/static/bootstrap/3.3.7/js/bootstrap.min.js" type="text/javascript"
            charset="utf-8"></script>
    <script src="__STATIC_URL__/static/js/bootstrap-datetimepicker.js" type="text/javascript" charset="utf-8"></script>
    <script src="__STATIC_URL__/static/js/commen.js" type="text/javascript" charset="utf-8"></script>
    <script src="__STATIC_URL__/static/js/template.js"></script>
    <script src="__STATIC_URL__/static/js/bootstrapSwitch.js"></script>
    <script src="__STATIC_URL__/static/layer/layer.js"></script>

    <!--<script src="https://cdn.bootcss.com/zclip/1.1.2/ZeroClipboard.swf"></script>-->
    <style>
        .info-row {
            line-height: 32px;
            color: #333;
        }

        .info-row label {
            padding-left: 15px;
            padding-right: 15px;
            font-weight: 400;
        }
    </style>
</head>
<body>
{include file='public/header'/}
<!------------------导航-------------------------->
<section>
    {include file='public/left'/}
    <!--------------------------主要内容区域------------------------------------->
    <div class="content">
        <!--路径导航-->
        <div class="page-heading mgl15 mgr15">
            <ul class="breadcrumb">
                <li>当前位置是&nbsp;:</li>
                <li>
                    <a href="javascirpt:;">营销活动</a>
                </li>
                <li class="active" style="color: #02b87f;">支付后广告列表</li>
            </ul>
        </div>
        <!--内容列表-->
        <!---
        <div class="alert alert-success alert-dismissible mgl15 mgr15" role="alert">
            <button type="button" class="close" data-dismiss="alert" aria-label="Close">
                <span aria-hidden="true">&times;</span>
            </button>
            设置说明：高级设置可设置卡券支付时的自动抵扣，目前开放了代金券和折扣券的自动抵扣设置，其他类型卡券暂不支持。
        </div>
      -->
        <div class="panel panel-default mgl15 mgr15">
            <div class="panel-heading addCharts" style="background:#ededed;">支付后广告列表

                <a class="btn btn-info pull-right" href="{:url('marke/advertadd')}"
                   style="    margin-top: -7px;">添加支付广告</a>

            </div>
            <div class="panel-body">

                <table class="table table-bordered" data-toolbar="#toolbar">
                    <thead>
                    <tr>
                        <th>ID</th>
                        <th>名称</th>
                        <th>状态</th>
                        <th>开始时间</th>
                        <th>结束时间</th>
                        <th>添加时间</th>
                        <th>投放链接</th>
                        <th>操作</th>
                    </tr>
                    </thead>
                    <tbody>

                    <tr>
                        {volist name="list" id="vo"}
                        <td>{$vo['id']}</td>
                        <td>{$vo['title']}</td>
                        <td>
                            <a class="btn-link" href="javascript:;" data-id="{$vo['id']}" onclick="statu(this);">{if condition="$vo['statu']=='0' "}下架{else/}上架{/if} </a>
                        </td>
                        <td>{$vo['start_time']|date="Y-m-d",###}</td>
                        <td>{$vo['end_time']|date="Y-m-d",###}</td>
                        <td>{$vo['create_time']}</td>
                        <td><a href="javascript:;" data-clipboard-action="copy"
                               data-clipboard-text=""
                               class="copytext">点击复制</a></td>
                        <td><a href="{:url('marke/advertdel',['id'=>$vo['id']])}" class="btn-link">删除</a>|<a href="{:url('marke/advertedit',['id'=>$vo['id']])}" class="btn-link">修改</a></td>
                    </tr>
                    {/volist}
                    </tbody>
                </table>

            </div>

        </div>
        {include file='public/footer'/}
    </div>

</section>
</body>
<script src="__STATIC_URL__/static/js/clipboard.min.js"></script>
<script>
    // $(function () {

    var clipboard =  new Clipboard('.copytext');

    clipboard.on('success', function (e) {
        layer.msg('复制成功');
    });

    clipboard.on('error', function (e) {
        layer.msg('复制失败');
    });
    // })
</script>
<script type="text/javascript">
    function statu(obj) {
        var id = $(obj).attr("data-id");
        // console.log(id);
        $.ajax({
            url: "{:url('marke/advertstatu')}",
            type: "post",
            data: {
                id: id
            },
            success: function (data) {
                // console.log(11, data);
                //window.location.reload();

            }
        })

    }

    $(function () {
        $('#myModal').on('hide.bs.modal', function () {
            $("#home img").attr("src", '');
            $("#codeone").attr("href", '#');
        });
        $("#cardModal").on('show.bs.modal', function () {
            var id = $(event.target).data("id");
            var datas = {};
            $.ajax({
                url: "{:url('cards/getinfocards')}",
                type: "post",
                data: {
                    id: id
                },
                success: function (data) {
                    $("#nick-name").text(data.nickname);
                    datas.list = data;
                    var html = template('modallist', datas);
                    $("#templateHtml").html(html);
                }
            })
        });
    })
</script>


</html>
